package com.xy.biz.xd.domain.converter;

import java.util.Collection;
import java.util.List;

import com.xy.biz.xd.domain.bo.DocumentFlowHandleBO;
import com.xy.biz.xd.domain.po.DocumentFlowHandlePO;
import com.xy.biz.xd.domain.query.DocumentFlowHandleQuery;
import com.xy.biz.xd.domain.resp.DocumentFlowHandleTimeLineResponse;
import com.xy.biz.xd.domain.resp.GetDocumentFlowHandleResponse;
import com.xy.tool.util.BeanUtilsEx;
//import com.xy.biz.xd.domain.resp.GetDocumentFlowHandleResponse;
//import com.xy.biz.xd.domain.req.SaveDocumentFlowHandleRequest;
//import com.xy.biz.xd.domain.req.ListDocumentFlowHandleRequest;

/**
 *
 *
 * @author wwj
 * @date 2021-2-4
 */
public class DocumentFlowHandleConverter {

	public static DocumentFlowHandlePO toPO(DocumentFlowHandleBO source) {
		return BeanUtilsEx.copyProperties(source, () -> new DocumentFlowHandlePO(), true);
	}

	public static List<DocumentFlowHandlePO> toPO(Collection<DocumentFlowHandleBO> source) {
		return BeanUtilsEx.copyPropertiesForNewList(source, () -> new DocumentFlowHandlePO(), true);
	}

	public static DocumentFlowHandleBO fromPO(DocumentFlowHandlePO source) {
		return BeanUtilsEx.copyProperties(source, () -> new DocumentFlowHandleBO());
	}

	public static List<DocumentFlowHandleBO> fromPO(Collection<DocumentFlowHandlePO> source) {
		return BeanUtilsEx.copyPropertiesForNewList(source, () -> new DocumentFlowHandleBO());
	}

//	public static DocumentFlowHandleBO toBO(SaveDocumentFlowHandleRequest source) {
//		return BeanUtilsEx.copyProperties(source, () -> new DocumentFlowHandleBO(), true);
//	}
//
//	public static List<DocumentFlowHandleBO> toBO(Collection<SaveDocumentFlowHandleRequest> source) {
//		return BeanUtilsEx.copyPropertiesForNewList(source, () -> new DocumentFlowHandleBO(), true);
//	}

//	public static GetDocumentFlowHandleResponse toResponse(DocumentFlowHandleBO source) {
//		return BeanUtilsEx.copyProperties(source, () -> new GetDocumentFlowHandleResponse());
//	}
//
	public static List<GetDocumentFlowHandleResponse> toResponse(Collection<DocumentFlowHandleBO> source) {
		return BeanUtilsEx.copyPropertiesForNewList(source, () -> new GetDocumentFlowHandleResponse());
	}
	public static GetDocumentFlowHandleResponse toResponse(DocumentFlowHandleBO source) {
		return BeanUtilsEx.copyProperties(source, () -> new GetDocumentFlowHandleResponse());
	}


	public static List<DocumentFlowHandleTimeLineResponse> toTimeLineResponse(Collection<DocumentFlowHandleBO> source) {
		return BeanUtilsEx.copyPropertiesForNewList(source, () -> new DocumentFlowHandleTimeLineResponse());
	}
//
//	public static DocumentFlowHandleQuery toQuery(ListDocumentFlowHandleRequest source) {
//		if(null == source) {
//			return null;
//		}
//		DocumentFlowHandleQuery target = new DocumentFlowHandleQuery(source.getPageIndex(), source.getPageSize());
//		BeanUtilsEx.copyProperties(source, target);
//		return target;
//	}

}
